import random
import numpy as np

if __name__ == '__main__':
    # 生成一个包含4行的二维列表
    matrix = []

    for _ in range(4):
        # 生成包含12个随机数字的列表
        row = [random.randint(4, 5) for _ in range(12)]
        matrix.append(row)

    # 将二维列表转换为NumPy数组
    matrix_array = np.array(matrix)
    print(matrix_array)
    # 计算每一列的平均值
    column_means = np.mean(matrix_array, axis=0)

    # 打印每一列的平均值
    print("每一列的平均值：", column_means)

    print("求和结果：", column_means.sum())



